// 分类接口
import API from '../index.js'

// 创建新的类别
export function add(data) {
	return API({
		url: '/admin/category',
		method: 'post',
		data: data
	})
}
//获取类别列表
export function list(data) {
	return API({
		url: '/admin/category',
		method: 'get',
		params: data
	})
}

//类别分页查询
export function pageList(data) {
	return API({
		url: '/admin/admin',
		method: 'get',
		params: data
	})
}
//根据id查找分类
export function idQuery(data) {
	const url = `/admin/category/${data.categoryId}`;
	return API({
		url: url,
		method: 'get',
		params: data
	})
}
//根据id修改分类
export function update(data) {
	return API({
		url: '/admin/category',
		method: 'put',
		data: data
	})
}


